﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

namespace AdventureWorks.DashboardGroep7
{
    public partial class Poc : System.Web.UI.MasterPage
    {
        /// <summary>
        /// Renders the left-menu, checks whether a service is available, if so: add it to the menu.
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                try
                {
                    groep6Service.AverageProductLifecycle Groep6Service1 = new groep6Service.AverageProductLifecycle();

                    String reportName = Groep6Service1.ToString();
                    reportName = reportName.Replace("AdventureWorks.DashboardGroep7.", "");
                    MenuItem item = new MenuItem(reportName, "6");
                    
                    menu_reports.Items.Add(item);
                }
                catch
                {
                }

                try
                {
                    groep7Service.MonthOverviewShippingMethodGroep7 Groep7Service1 = new groep7Service.MonthOverviewShippingMethodGroep7();

                    String reportName = Groep7Service1.ToString();
                    reportName = reportName.Replace("AdventureWorks.DashboardGroep7.", "");

                    MenuItem item = new MenuItem(reportName, "7");
                    menu_reports.Items.Add(item);
                }
                catch
                {
                }

                try
                {
                    groep8Service.ReportService Groep8Service1 = new groep8Service.ReportService();

                    String reportName = Groep8Service1.ToString();
                    reportName = reportName.Replace("AdventureWorks.DashboardGroep7.", "");

                    MenuItem item = new MenuItem(reportName, "8");
                    menu_reports.Items.Add(item);

                }
                catch
                {
                }
            }         
        }
    }
}
